package org_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 组织-运输主体性质
type orgTransportEnterpriseClientType int

var OrgTransportEnterpriseClientType orgTransportEnterpriseClientType

// 企业
func (c *orgTransportEnterpriseClientType) Enterprise() int {
	return 1
}

// 车队(临时)
func (c *orgTransportEnterpriseClientType) CarTeam() int {
	return 2
}

func (c *orgTransportEnterpriseClientType) ToText(value int) string {
	switch value {

	case 1:
		return "企业"

	case 2:
		return "车队(临时)"

	}
	return ""
}

func (c *orgTransportEnterpriseClientType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *orgTransportEnterpriseClientType) ToValue(text string) int {
	switch text {

	case "企业":
		return 1

	case "车队(临时)":
		return 2

	}
	return 0
}
